home *** CD-ROM | disk | FTP | other *** search
- /*
- ** MULTI.C [edit EMAIL.H before compiling].
- **
- ** This program emails two messages, including a
- ** MIME attachment.
- */
-
- // IMPORTANT: edit these definitions before compiling
- #include "email.h"
- #define FIRST_SEND_TO "1st receipient's email address"
- #define SECOND_SEND_TO "2nd receipient's email address"
-
- #include <windows.h>
- #include <stdio.h>
- #include "see.h"
-
- static char Buffer[512];
-
- void ErrorExit(int Code)
- {seeErrorText(Code,(LPSTR)Buffer,512);
- printf("%s\n", Buffer);
- exit(0);
- }
-
- /*** main ***/
-
- void main(void)
- {int Code;
- /* define diagnostics log file */
- ///seeStringParam(SEE_LOG_FILE, (LPSTR)"multi.log");
- /* connect to SMTP server */
- puts("Connecting...");
- Code = seeSmtpConnect(
- (LPSTR)SMTP_HOST_NAME, /* SMTP server */
- (LPSTR)YOUR_EMAIL_ADDR, /* our return email address */
- (LPSTR)NULL); /* Reply-To header */
- if(Code<0) ErrorExit(Code);
-
- /* send first email */
- puts("Sending email #1 ...");
- Code = seeSendEmail(
- (LPSTR)FIRST_SEND_TO, /* To list */
- (LPSTR)NULL, /* CC list */
- (LPSTR)NULL, /* BCC list */
- (LPSTR)"MULTI Example Program", /* subject */
- (LPSTR)"Hello from MULTI.C !!!\r\nBye!", /* text message */
- (LPSTR)NULL); /* no attachment */
- if(Code<0) ErrorExit(Code);
-
- /* send second email */
- puts("Sending email #2 ...");
- Code = seeSendEmail(
- (LPSTR)SECOND_SEND_TO, /* To list */
- (LPSTR)NULL, /* CC list */
- (LPSTR)NULL, /* BCC list */
- (LPSTR)"MULTI Example Program", /* subject */
- (LPSTR)"@test.mai", /* message in file */
- (LPSTR)"test.zip"); /* attachment (size will be multiple of 4) */
- if(Code<0) ErrorExit(Code);
- puts("Closing...");
- Code = seeClose();
- if(Code<0) ErrorExit(Code);
- } /* end main */
-
-
-